package com.jzo2o.orders.manager.hander;

import com.jzo2o.common.expcetions.CommonException;
import com.jzo2o.orders.base.model.domain.Orders;
import com.jzo2o.orders.manager.model.dto.request.PlaceOrderReqDTO;
import lombok.extern.slf4j.Slf4j;

/**
 * 订单检查处理类
 */
@Slf4j
public class CheckOrderHandler extends OrderHandler {
    @Override
    public void process(Orders orders, PlaceOrderReqDTO reqDTO) {
        log.info("下单参数检查处理");
        if (reqDTO.getServeId() == null || reqDTO.getAddressBookId() == null || reqDTO.getPurNum() == null || reqDTO.getServeStartTime() == null) {
            throw new CommonException("下单参数错误");
        }
        orderHandler.process(orders, reqDTO);
    }
}
